function compareTags() {
	var textBar = document.getElementById("searchbar").value;
	var numberColumns = Math.floor(document.body.clientWidth * 0.8 / 210);
	var line = "";

	for( i = 0; i < imagesIndex.length(); i++) {
		if(images[i].tags!=undefined && images[i].tags.search(textBar) != -1) {
			line += "<img class='searchImg' src='" + images[i].img_src + "' id=image'" + i + "'>";
		}
	}
	document.getElementById("g_container").innerHTML = line;
	
	for( i = 0; i < imagesIndex.length(); i++) {

		if(images[i].title!=undefined && images[i].title.search(textBar) != -1 && document.getElementById("image'" + i)) {
			line += "<img class='searchImg' src='" + images[i].img_src + "' id=image'" + i + "'>";
		}
	}

	document.getElementById("g_container").innerHTML = "<div id=searchContainer>"+ line + "</div>";

}